﻿<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>服务区-管理系统</title>
<link rel="stylesheet" type="text/css" href="/IMS/css/DefaultSkin.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/load.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/control.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/list.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/anim.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/page.css?v=1.0" /><!-- 这个里面有字体,加个版本号不进行更新 -->
<link rel="stylesheet" type="text/css" href="/IMS/css/comm.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/select2/select2.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/zTreeStyle/zTreeStyle.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/core.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/js/plugins/file/uploadify/uploadify.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/js/plugins/treeview/jquery.treeview.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/multi-select.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/js/plugins/bsgrid/bsgrid.all.min.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/js/plugins/bsgrid/bsgrid.all.min.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/jeasy-ui/easyui.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/js/plugins/poshytip/tip-darkgray/tip-darkgray.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/addinfo.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/prettyPhoto.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/jquery-ui-1.10.4.custom.min.css?v=20180724173917116" />
<link rel="stylesheet" type="text/css" href="/IMS/css/jquery.editable-select.min.css?v=20180724173917116" />
<script type="text/javascript" src="/IMS/js/jquery-1.11.2.min.js?v=20180724173917200"></script>
<!-- 新增加 -->
<script type="text/javascript" src="/IMS/js/plugins/comm/jquery-ajax.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/comm/securityProtect.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/comm/jquery-ajax-response-handler.js?v=20180724173917200"></script>
<!-- 新增加 END -->
<script type="text/javascript" src="/IMS/js/common/public-obj.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/bind.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/controls.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/slide.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/switch.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/initial.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/print/printhtml.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/listBox.js?v=20180724173917200"></script>

<script type="text/javascript" src="/IMS/js/plugins/My97DatePicker/WdatePicker.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/file/uploadify/jquery.uploadify.min.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/layer/layer.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/select2/select2.full.min.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/select2/i18n/zh-CN.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/treeview/jquery.treeview.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/form/jquery.form.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/ztree/jquery.ztree.core-3.5.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/ztree/jquery.ztree.excheck-3.5.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/comm/constant.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/comm/common.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/comm/bmsAjax.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/comm/validata.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/validate/jquery.validate.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/validate/localization/messages_zh.min.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/validate/regValidate.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/popup_layer.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/jqueryPlugins/jquery_magnifier.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/jqueryPlugins/jquery.multi-select.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/jqueryPlugins/jquery.quicksearch.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/jquery.easyui.min.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/jqueryPlugins/jquery.prettyPhoto.js?v=20180724173917200"></script>

<script type="text/javascript" src="/IMS/js/plugins/bsgrid/grid.zh-CN.min.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/bsgrid/bsgrid.all.min.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/bsgrid/grid.extend.min.js?v=20180724173917200"></script>
<script type="text/javascript" charset="UTF-8" src="/IMS/js/plugins/poshytip/jquery.poshytip.js?v=20180724173917200"></script>

<script type="text/javascript" src="/IMS/js/common/jqueryPlugins/jquery-ui-1.10.4.custom.min.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/joinUs/AddListBox.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/common/jqueryPlugins/jquery.editable-select.min.js?v=20180724173917200"></script>

<!-- echarts -->
<script type="text/javascript" src="/IMS/js/plugins/echarts/dist/echarts.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/bar.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/line.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/pie.js?v=20180724173917200"></script>
<script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/funnel.js?v=20180724173917200"></script>

<!-- bootstrap -->












<script>
	document.isDebug = false; //指console.log不打印日志。如果需要打印请改为true
	document.domain = location.hostname;
	//获取验证码
	var _SECURITY_PROTECT_VERIFY_URL = '/IMS/securityProtect/verify.ht';
	//校验验证码
	var _SECURITY_PROTECT_CHECK_VERIFY_URL = '/IMS/securityProtect/checkverify.ht';
	//检验URL是否需要验证
	var _SECURITY_PROTECT_CHECK_URL = '/IMS/securityProtect/check.ht';;
	
	var isIE = (function () {
		var ua = window.navigator.userAgent.toLowerCase();
		if (ua.indexOf("msie") > 0 || ua.indexOf("trident") > 0 ) {
	    	return true;
		}else {
	    	return false;
		}
	}());
	
	 /*<![CDATA[*/
	function findDBInfo(){
	 	var url = '/IMS/pasMessage/list.ht';
		addTabs(url,'待办任务');
	}
 

		$(function(){
			
			function menuControl(){
				var _options=this.options={
					openCls:"active_subopen",//展开子列表后菜单盒子的class名
					disableCls:"active_subdisable",//展开子列表后菜单盒子的class名
                    menuWarpCls:"content",
                    menuSmall:"menu-small"
				};
				this.menuBox=$(".grid-s5m0");
                this.menuWarp=$("#"+_options.menuWarpCls);
                this.menuSmallBtn=this.menuBox.find(".menu-small-btn");
				this.menuBoxList=$(".menu-box-list .dd-item");
				this.menuIndex=$(".menu-box-list .dd-index");
				this.submenuOpenBtn=this.menuBox.find(".submenu-open");
				this.subMenuBox=this.menuBox.find(".dd-inner");
				this._userState=false;
                this._hide();
                this._menuBig();
                this._disable();
				this._bind();
			}
			menuControl.prototype={
				_resize:function(){
                    var _this=this,
                        win=$(window),
                        count=5;
//					$(window).resize();
                    _this._timeout && clearTimeout(_this._timeout);
					function wresize(){
                        win.resize();
                        count--;
                        if(count>0){
                            _this._timeout && clearTimeout(_this._timeout);
                            _this._timeout=setTimeout(function(){
                                wresize();
                            },100);
                        }
                    }
                    wresize();
				},
				/**
				*隐藏菜单
				*/
				_hide:function(){
					var _this=this,
					_tempOption=this.options;
					
					_this._state=false;
					// _this.menuBox.css({"width":"0px"});
                    
                    _this.menuBox.removeClass(_tempOption.disableCls);
					_this.menuBox.removeClass(_tempOption.openCls);
					_this._resize();
				},
                
                _disable:function(){
					var _this=this
					_tempOption=this.options;
                    
					_this.menuBox.addClass(_tempOption.disableCls);
                    _this.menuBox.removeClass(_tempOption.openCls);
                    _this._resize();
                },
				/**
				*打开菜单
				*/
				_open:function(){
					var _this=this,
					_tempOption=this.options;

					_this._state=true;
					//_this.menuBox.css({"width":"180px"});
                    _this.menuBox.removeClass(_tempOption.disableCls);
					_this.menuBox.addClass(_tempOption.openCls);
					_this._resize();
				},
                
                /**
                 * 最小化菜单
                 * @private
                 */
                _menuSmall:function(){
                    var _this=this,
					_tempOption=this.options;
                    
                    _this._menuState=false;
                    
                    _this.menuWarp.addClass(_tempOption.menuSmall);
                    _this._resize();
                },
                
                /**
                 * 最大化菜单
                 * @private
                 */
                _menuBig:function(){
                    var _this=this,
					_tempOption=this.options;
                    
                    _this._menuState=true;
                    
                    _this.menuWarp.removeClass(_tempOption.menuSmall);
                    _this._resize();
                },
				_bind:function(){
					var _this=this;
                    
                    
                    _this.menuSmallBtn.bind("click",function(){
						if(_this._menuState){
                            _this._userState=false;
							_this._menuSmall();
						}else{
                            _this._userState=true;
							_this._menuBig();
						}
					});
                    
					_this.submenuOpenBtn.bind("click",function(){
						if(_this._state){
							_this._hide();
						}else{
							_this._open();
						}
					});
                    _this.menuIndex.bind("click",function(){
                        _this._disable();
                    });
					_this.menuBoxList.bind("click",function(){
                        if(!_this._userState){
                            _this._menuSmall();
                        }
						_this._open();
					});
				}
			};

			new menuControl();

			function SetScroll() {
			    this._bind();
			}

			SetScroll.prototype = {
			    /**
			     * 添加事件方法
			     * @param {function} fn 事件调用的方法
			     * @param {Node} node 事件需要操作的节点                
			     */
			    addEvent: function (fn, node) {
			        if (fn && $.isFunction(fn)) {
			            this.eventList = this.eventList || [];
			            this.eventList.push({ fn: fn, node: node });
			        }
			    },

			    /**
			     * 事件触发时执行的事件
			     */
			    triggerEvt: function () {
			        var _this = this,
			            bodyscrollTop = _this._getScrollNode();

			        _this.eventList && $.each(_this.eventList, function () {
			            this.fn(bodyscrollTop.scrollTop, this.node);
			        });
			    },
			    /**
			     * 获取支持scrollTop的元素
			     * @protected
			     * @returns {Node} 返回支持Dom节点scrollTop的元素
			     */
			    _getScrollNode: function () {
			        return document.documentElement && document.documentElement.scrollTop ? document.documentElement : document.body;
			    },
			    /**
			     * 绑定事件
			     * @protected
			     */
			    _bind: function () {
			        var _this = this;
			        $(window).bind("scroll", function () {
			            _this.triggerEvt();
			        });
			    }
			};

			var scroll=new SetScroll(),//滚动条对象
				menuBox=$(".menu-box"),
				ddinner=$(".dd-inner");//子菜单列表盒子


				scroll.addEvent(function(scrollTop,scrolla){
					var top=50-scrollTop;
					if(top<=0){
						top=0;
					}
					scrolla.css({top:top});
					ddinner.css({top:top});
				},$(".menu-box"));

			$("img").error(function(){//图片加载错误
				$(this).attr("src", '/IMS/img/u146.png?');//设置默认图片
			});
			var imgUrl = '';
			
			$("#menu_tree").bind('click',function(event){
				if(event.target.className.indexOf("hitarea")>-1){
					if(YW.newobj){
						if(YW.newobj.leftheigth){
							YW.newobj.leftheigth.setSize();
						}
					}
				}
			})
			$(".item-hd,.dd-nav").bind('click',function(){
				if(YW.newobj){
					if(YW.newobj.leftheigth){
						YW.newobj.leftheigth.setSize();
					}
				}
			});
		});
		  function clearList(){
			  $(".icip_pull_item").each(function(){
					  $(this).removeClass("icip_button_c2");
			  });
		  }
	     $(function(){
	           $(".icip_pull_item").click(function(){
	        	   clearList();
	     		 var pageSize=$(this).attr("name");
	     		  $(this).addClass("icip_button_c2");
	     		  $("#pageSize").val(pageSize);
	     		 go($("#pagenumber").html());
	           });
	           //展开更多
	           (function(){
	               $(".icip_btn_more").delegate(".icip_more_show","mouseover",function(){
	                   $(this).parents('.icip_btn_more').addClass("icip_active");
	               });
	               $(".icip_btn_more").on("mouseout",function(evt){
	                   if(!$(this).find(evt.relatedTarget)[0]){
	                       $(this).removeClass("icip_active");
	                   }
	               });
	             
	           })();
	       });
/*]]>*/
</script>
</head>
<SCRIPT> 
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
/*<![CDATA[*/
/**
 * 树渲染需要的参数设置
 */
var setting = {  
	async: {
		dataType:"json",
		enable: true,
		url: getUrl,
		dataFilter: filter
	},
	check: {  
        enable: false  
    },  
    data: {  
        simpleData: {  
            enable: true  
        }  
    }  ,
    callback: {
    	beforeExpand: beforeExpand,
		onAsyncSuccess: onAsyncSuccess,
		onAsyncError: onAsyncError,
		onClick: zTreeOnClick
	}
};

function filter(treeId, parentNode, childNodes) {
	 return childNodes.result;
}
function getUrl(treeId, treeNode) {
	var url = '/IMS/getNodeComapnyList.ht';
	url = url+"?pid="+treeNode.id;
	return url;
}

function beforeExpand(treeId, treeNode) {
	if (!treeNode.isAjaxing) {
		ajaxGetNodes(treeNode, "refresh");
		return true;
	} else {
		alert("zTree 正在下载数据中，请稍后展开节点。。。");
		return false;
	}
}
function onAsyncSuccess(event, treeId, treeNode, msg) {
	var m = JSON.parse(msg);
	if (!msg || msg.length == 0) {
		return;
	}
	var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
	totalCount = treeNode.count;
	if (treeNode.children.length < totalCount) {
		setTimeout(function() {ajaxGetNodes(treeNode);}, 10);
	} else {
		zTree.updateNode(treeNode);
	}
}
function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
	var zTree = $.fn.zTree.getZTreeObj("treeDemo");
	alert("异步获取数据出现异常。");
	treeNode.icon = "";
	zTree.updateNode(treeNode);
}
function ajaxGetNodes(treeNode, reloadType) {
	var zTree = $.fn.zTree.getZTreeObj("treeDemo");
	if (reloadType == "refresh") {
		zTree.updateNode(treeNode);
	}
	zTree.reAsyncChildNodes(treeNode, reloadType, true);
}
/**
 * 树点击的时候方法
 */
function zTreeOnClick (event, treeId, treeNode){
	parent.$('#nodeList').val(treeNode.list);
	parent.$('#parCompanyName').val(treeNode.name);
	parent.$('#parCompanyNum').val(treeNode.id);
	parent.$('#comCode').val(treeNode.comCode);
	if(document.LAYER_INDEX){
		parent.layer.close(document.LAYER_INDEX);
	}else{
		parent.layer.close(parent.layer.index);
	}
}
var zNodes ;  
var code;  
function setCheck() {  
    var zTree = $.fn.zTree.getZTreeObj("treeDemo"),  
    py = $("#py").attr("checked")? "p":"",  
    sy = $("#sy").attr("checked")? "s":"",  
    pn = $("#pn").attr("checked")? "p":"",  
    sn = $("#sn").attr("checked")? "s":"",  
    type = { "Y":py + sy, "N":pn + sn};  
    zTree.setting.check.chkboxType = type;  
    showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');  
}  
function showCode(str) {  
    if (!code) code = $("#code");  
    code.empty();  
    code.append("<li>"+str+"</li>");  
}  
function createTree(data){  
    zNodes=data;  
    $.fn.zTree.init($("#treeDemo"), setting, zNodes);  
    setCheck();  
    $("#py").bind("change", setCheck);  
    $("#sy").bind("change", setCheck);  
    $("#pn").bind("change", setCheck);  
    $("#sn").bind("change", setCheck);  
}  
$(document).ready(function(){  
 	var form = $('#treeform');
    $("#fpPcid").val(parent.$('#pcid').val());
    $.submit(form,{
    	dataType:'json',
    	beforeSend: showProccessBar,
		complete: hideProccessBar,
    	success:function(data,textStatus){
    		createTree(data.result);  
    	}
    });
}); 
/*]]>*/
</SCRIPT>
<body>
<body>
	<form method="post" id="treeform" action="/IMS/getTopCompanyList.ht">
		<input type="hidden" name="fpPcid" id="fpPcid" value="" />
		<div class="aa">
			<div class="ztree" id="treeDemo"></div>
		</div>
	</form>
</body>
</body>
</html>